package chai.ning.args;

// public 是一个 访问修饰符 ( Access Modifier )
// public 修饰一个类时，表示该类在本包之外仍然可以被使用
public class Human {
	
	// private 表示私有的，如果用来修饰 字段，则表示该字段仅限本类内部使用
	private String name ;
	private char gender ;
	
	public void set( String name , char gender ) {
		this.name = name ;
		this.gender = gender ;
	}
	
	public void introduce() {
		System.out.println( this.name + " , " + this.gender );
	}
	
	public void change( Human customer ) {
		System.out.println( System.identityHashCode( customer ) );
		if( customer != null ) {
			//customer.gender = customer.gender == '男' ? '女' : ( customer.gender == '女' ? '男' : customer.gender );
			if( customer.gender == '男' ) {
				customer.gender = '女' ;
			} else if( customer.gender == '女' ) {
				customer.gender = '男' ;
			}
		}
	}
	
	public static void main(String[] args) {
		Human h = new Human();
		h.name = "牛大夫" ;
		h.gender = '男' ;
		
	}

}
